﻿namespace Blaze.Framework.MonoEventListeners
{
    using UnityEngine;

    public class Trigger : MonoBehaviour
    {
        public event ColliderEventHandler OnTriggerEnterEvent;

        public event ColliderEventHandler OnTriggerExitEvent;

        public event ColliderEventHandler OnTriggerStayEvent;

        private void OnTriggerEnter(Collider collider)
        {
            if (OnTriggerEnterEvent != null)
                OnTriggerEnterEvent(gameObject, collider);
        }

        private void OnTriggerExit(Collider collider)
        {
            if (OnTriggerExitEvent != null)
                OnTriggerExitEvent(gameObject, collider);
        }

        private void OnTriggerStay(Collider collider)
        {
            if (OnTriggerStayEvent != null)
                OnTriggerStayEvent(gameObject, collider);
        }
    }
}